package aqv

class Politician {

	String name
	String surName
	PoliticalParty politicalParty
	PoliticalPartyRole politicalPartyRole
	byte[] profilePic
	Date birthDate
	String description
	
	static belongsTo = [PoliticalParty, PoliticalPartyRole]
	
	static hasMany = [projects: Project]
	
    static constraints = {
		name blank: false
		surName blank: false
		birthDate blank : false
		description blank : false
		politicalParty nullable:false
		politicalPartyRole nullable:false
		profilePic(maxSize: 1000000)
    }
	
	//static transients = ['profilePic']
	
	static mapping = {
		tablePerHierarchy false
		politicalParty lazy: false
		politicalPartyRole lazy: false
		//profilePic column:"profile_pic", sqlType: "blob"
	}
}
